<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
    <!--
    Created by Artisteer v3.1.0.46558
    Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"
    -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Main</title>

<link href="quiz.css" rel="stylesheet" type="text/css">
</head>


<body>
<div align="center"><strong></strong></div>
<?php
include("database.php");
include("header.php");
extract($_POST);
if(isset($submit))
{	
	
	$rs=mysql_query("select * from mst_user where login='$loginid' and pass='$pass'") or die("Could not Connect My Sql");
	$rs1=mysql_query("SELECT * FROM `mst_user` where auth='0' and login='$loginid'") or die("Could not Connect My Sql");
	
	if(mysql_num_rows($rs)<1)
	{	
		$found="N";
	}
	elseif(mysql_num_rows($rs1)==1)
	{
		
		echo "<BR><BR><BR><BR><div class=head1> Administration Pending  <div>";
		echo "<BR><BR><BR><BR><div class=head1> <br> Go Back To Login Page <a href=index.php>Login</a><div>";
		exit;
		
	}
	else
	{
		
		$_SESSION[login]=$loginid;
	}

}


if (isset($_SESSION[login]))
{
	 //echo "<div align=\"right\"><strong><a href=\"index.php\"> Home </a>|<a href=\"signout.php\">Signout</a></strong></div>";

echo "<h1 class='style8' align=center>Wel come to Online Exam $a</h1>";
		echo '<table width="28%"  border="0" align="center">
  <tr>
    <td width="7%" height="65" valign="bottom"><img src="image/HLPBUTT2.JPG" width="50" height="50" align="middle"></td>
    <td width="93%" valign="bottom" bordercolor="#0000FF"> <a href="sublist.php" class="style4">Select subject </a></td>
  </tr>
  <tr>
   <h1></h1>;
    <td height="58" valign="bottom"><img src="image/DEGREE.JPG" width="43" height="43" align="absmiddle"></td>
    <td valign="bottom"> <a href="result1.php" class="style4">Result </a></td>
  </tr>
</table>';
   
	exit;
}

?>
<table width="100%" border="0">
  <tr>
    <td width="70%" height="25">&nbsp;</td>
    <td width="1%" rowspan="2" bgcolor="#CC3300"><span class="style6"></span></td>
    <td width="29%" bgcolor="#CC3333"><div align="center" class="style1">Student Login </div></td>
  </tr>
  <tr>
    <td height="296" valign="top"><img src="images/preview.jpg" /></td>
   <center><h3> <a href="index.html">Home Page</a><h3></center>
    <td valign="top"><form name="form1" method="post" action="">
      <table width="200" border="0">
        <tr>
          <td><span class="style2">Login ID </span></td>
          <td><input name="loginid" type="text" id="loginid2"></td>
        </tr>
        <tr>
          <td><span class="style2">Password</span></td>
          <td><input name="pass" type="password" id="pass2"></td>
        </tr>
        <tr>
          <td colspan="2"><span class="errors">
            <?php
		  if(isset($found))
		  {
		  	echo "Invalid Username or Password";
		  }
		  if(isset($hari))
		  {
		  echo "Administrator not given permition to log in ";
		  }
		  ?>
          </span></td>
          </tr>
        <tr>
          <td colspan=2 align=center class="errors">
		  <input name="submit" type="submit" id="submit" value="Login">		  </td>
        </tr>
        <tr>
          <td colspan="2" bgcolor="#CC3300"><div align="center"><span class="style4">New User ? <a href="signup.php">Signup </a></span></div></td>
          
        </tr>
      </table>
      <div align="center">
        <p class="style5"><img src="images/topleft.jpg" width="134" height="128">          </p>
        </div>
    </form></td>
  </tr>
</table>

</body>
</html>
